﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.Common;
using System.Data.SqlClient;

/// <summary>
/// DBHelperConn 的摘要描述
/// </summary>
namespace Chi.Lib.DBHelper
{
    public class DBHelperConnection
    {
        private static SqlConnection _DBHelperConn;
        public static string _ConnStr = ConfigurationManager.ConnectionStrings["MasertDB"].ConnectionString;
        public static SqlConnection GetConnection()
        {
            if (_DBHelperConn == null)
            {
                _DBHelperConn = new SqlConnection(_ConnStr);
            }
            if (_DBHelperConn != null && _DBHelperConn.ConnectionString == null)
            {
                _DBHelperConn.ConnectionString = _ConnStr;
            }
            return _DBHelperConn;
        }
    }
}